/*
 * UICtrl.h
 *
 *  Created on: 2010-3-30
 *      Author: Administrator
 */

#ifndef UICTRL_H_
#define UICTRL_H_

#include <COECNTRL.H>
#include "IUIControl.h"
#include <e32std.h>
#include <EIKAPPUI.H>
#include "IUITheme.h"
#include "UIThemeFactory.h"
#include "writablebitmap.h"

class UICtrl : public CCoeControl
	{
private:
	UICtrl();
public:
	virtual ~UICtrl();
	
public:
	void ConstructL(const CCoeControl* aParent);
	static UICtrl* NewL(const CCoeControl* aParent);
	static UICtrl* NewLC(const CCoeControl* aParent);
	
public:
	void Draw(const TRect& aRect) const;
	void SizeChanged();
	
public:
	void LoadFromXml(const TDesC& aSrc,UIThemeFactory::TUITheme aTheme = UIThemeFactory::ETheme_Normal);
	void SetUITheme(UIThemeFactory::TUITheme);
private:
	void Layout();
	
private:
	IUIControl* iUIControl;
	IUITheme* iUITheme;
	CWritableBitmap* iBitmap;
	};

#endif /* UICTRL_H_ */
